/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package do_.com.bpd.business.referrals.referralservermanager.ws;

import do_.bpd.hr.bank.referrals.api.NonExistentReferral;
import do_.bpd.hr.bank.referrals.api.ResultVO;
import do_.bpd.hr.bank.referrals.api.VOReferral;
import do_.com.bpd.business.referrals.referralservermanager.facade.ReferralSystemSessionRemote;
import java.util.List;
import javax.ejb.EJB;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ejb.Stateless;

/**
 *
 * @author Samuel Pichardo
 */
@WebService(serviceName = "NewWebService")
@Stateless()
public class NewWebService {
    @EJB
    private ReferralSystemSessionRemote ejbRef;// Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Web Service Operation")

    @WebMethod(operationName = "loggin")
    @Oneway
    public void loggin(@WebParam(name = "lLoggedUser") String lLoggedUser) {
        ejbRef.loggin(lLoggedUser);
    }

    @WebMethod(operationName = "createReferral")
    public ResultVO createReferral(@WebParam(name = "obj") VOReferral obj) throws Exception {
        return ejbRef.createReferral(obj);
    }

    @WebMethod(operationName = "listEmployeeReferrals")
    public String listEmployeeReferrals(@WebParam(name = "employeeId") String employeeId) {
        return ejbRef.listEmployeeReferrals(employeeId);
    }

    @WebMethod(operationName = "listStatusReferrals")
    public List<String> listStatusReferrals() {
        return ejbRef.listStatusReferrals();
    }

    @WebMethod(operationName = "getReferral")
    public String getReferral(@WebParam(name = "referralId") String referralId) throws NonExistentReferral {
        return ejbRef.getReferral(referralId);
    }

    @WebMethod(operationName = "getAllReferrals")
    public String getAllReferrals(@WebParam(name = "filter") String filter) {
        return ejbRef.getAllReferrals(filter);
    }

    @WebMethod(operationName = "deleteReferrer")
    public String deleteReferrer(@WebParam(name = "referrerId") String referrerId) {
        return ejbRef.deleteReferrer(referrerId);
    }

    @WebMethod(operationName = "activateReferrer")
    public String activateReferrer(@WebParam(name = "referrerId") String referrerId, @WebParam(name = "comment") String comment) {
        return ejbRef.activateReferrer(referrerId, comment);
    }

    @WebMethod(operationName = "suspendReferrer")
    public String suspendReferrer(@WebParam(name = "referrerId") String referrerId, @WebParam(name = "comment") String comment) {
        return ejbRef.suspendReferrer(referrerId, comment);
    }

    @WebMethod(operationName = "createReferrer")
    public String createReferrer(@WebParam(name = "referrerInfo") String referrerInfo) {
        return ejbRef.createReferrer(referrerInfo);
    }

    @WebMethod(operationName = "getReferrers")
    public String getReferrers() {
        return ejbRef.getReferrers();
    }

    @WebMethod(operationName = "reassignReferral")
    public String reassignReferral(@WebParam(name = "referralId") String referralId, @WebParam(name = "newReferrerId") String newReferrerId) {
        return ejbRef.reassignReferral(referralId, newReferrerId);
    }

    @WebMethod(operationName = "changeReferralStatus")
    public String changeReferralStatus(@WebParam(name = "referralId") int referralId, @WebParam(name = "newStatus") String newStatus) throws Exception {
        return ejbRef.changeReferralStatus(referralId, newStatus);
    }

    @WebMethod(operationName = "getDeletedReferrals")
    public String getDeletedReferrals() {
        return ejbRef.getDeletedReferrals();
    }

    @WebMethod(operationName = "deleteReferrals")
    public String deleteReferrals(@WebParam(name = "referralIds") String referralIds, @WebParam(name = "comment") String comment) {
        return ejbRef.deleteReferrals(referralIds, comment);
    }

    @WebMethod(operationName = "deleteReferral")
    public String deleteReferral(@WebParam(name = "referralId") String referralId, @WebParam(name = "comment") String comment) {
        return ejbRef.deleteReferral(referralId, comment);
    }

    @WebMethod(operationName = "createNewReferral")
    public String createNewReferral(@WebParam(name = "newReferralData") String newReferralData) {
        return ejbRef.createNewReferral(newReferralData);
    }

    @WebMethod(operationName = "listOwnReferrals")
    public String listOwnReferrals() {
        return ejbRef.listOwnReferrals();
    }

    @WebMethod(operationName = "saveReferral")
    public String saveReferral(@WebParam(name = "referral") String referral) {
        return ejbRef.saveReferral(referral);
    }

    @WebMethod(operationName = "filterReferral")
    public String filterReferral(@WebParam(name = "filter") String filter) {
        return ejbRef.filterReferral(filter);
    }
    
}
